package cmd

import (
	"svntool/application/models/linetool"
)

type CmdAbstruct struct {
	CI    CmdInterface
	Types string
}

func (c *CmdAbstruct) Exec(cmd string) (string, error) {
	var types string
	if c.Types == "" {
		types = linetool.GetLinetoolType()
	} else {
		types = c.Types
	}
	var output string
	var err error
	if types == "svn" {
		output, err = c.CI.Svn(cmd)
	} else {
		output, err = c.CI.Git(cmd)
	}
	return output, err
}
